Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Martingale Strategy

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

    #31
    I just removed the strategy line. I am able to test it now but, I am going to have to make changes since I had to remove lines 93 through 109 which start with {
    ExitLong(DefaultQuantity, "ExitBuy");
    sellCount = 0;
    entryPrice = 0.0;
    buyCount = 0;
    }
    }
    else if (Position.MarketPosition == MarketPosition.Short)
    {
    if (sellCount < EntriesPerDirection && currentPrice > entryPrice)
    {
    sellCount++;
    entryPrice = currentPrice;
    EnterShort(DefaultQuantity, "Sell2");
    }​

    Comment


      #32
      I hope you someone can help me? I tried to revise my script and now I am getting a code CS0101 on line 21 column 18. Any suggestions to make this go away without major updates. If I take out the word strategy or strategies (line20), I get a string of errors messages.

      Click image for larger version  Name:	image.png Views:	0 Size:	23.2 KB ID:	1239270
      Last edited by ReginaldS8; 03-09-2023, 10:27 PM.

      Comment


        #33
        Hello ReginaldS8,

        Thanks for your note.

        Please check the following items and advise if you have duplicate files listed.
        • Expand the 'Strategies' folder on the right side of the NinjaScript Editor and check if you have duplicate files listed.
        • Go to the Documents\NinjaTrader 8\bin\Custom\Strategies folder and check if duplicate files are listed.
        ​If you see any duplicate files listed, please remove the duplicate file and retest to see if the error persists.

        Let me know if I may assist further.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        58 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X