Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple entries Problem

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

    #16
    I don't know what I did Wrong

    NO COMMISSIONS on Strategy Analyzer. I set my commissions in options it doesn't show up.

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    and something is Up with my Code. I tried to make it Open 2 Trades. One for a quick Scalp which gets Closed on the 3rd Bar closing in a row. and the other on the Original Condition.

    It's Not working. my Code looks like this now:
    Code:
    	//ENTRY LONG:
    			/* When our indicator gives us a bull signal we enter long. Notice that we are accessing the
    			public BoolSeries we made in the indicator. */
    			if (Position.MarketPosition == MarketPosition.Flat && DG_HighVolumeScalper(5).BuySignal[0])
    			{
    				//DrawDot("My dot" + CurrentBar, false, 0, Close[0] - 10 * TickSize, Color.Blue);
    				EnterLong(1000, "Trend");
    				EnterLong(2000, "Scalp");
    				
    				buyTrigBar = CurrentBar -1;
    			}
    			
    		//STEP 2: EXITS
    						
    			//Trades DON't CLOSE until These conditions are met
    			
    			//Condition 1: the 3 Bar Scalp, Closes 2 contracts after the 3rd bar after Trig Bar Closes
    			if( (Position.MarketPosition == MarketPosition.Long) && (CurrentBar - 1 > buyTrigBar) && (CurrentBar < buyTrigBar + 3) && ((Close[0] > Open[0])) )
    			{	ExitLong("Scalp");	}
    			
    			//Condition 2: a bar closes in Opposite direction CLOSE any Open Positions
    			if( (Position.MarketPosition == MarketPosition.Long) && ((Close[0] < Open[0])) )
    			{
    				ExitLong();
    			}
    
    			
    			//ENTRY SHORT:
    			// When our indicator gives us a bear signal we enter short
    			if (Position.MarketPosition == MarketPosition.Flat && DG_HighVolumeScalper(5).SellSignal[0] )
    			{	
    				//DrawDot("My dot" + CurrentBar, false, 0, Close[0] + 10 * TickSize, Color.Red);
    				EnterShort(1000, "Trend");
    				EnterShort(2000, "Scalp");
    				
    				sellTrigBar = CurrentBar - 1;
    				
    			}
    			//STEP 2: EXITS
    			//Trades DON't CLOSE until This condition is met
    			//Condition 1: SCALP 3 bar Close in same direction
    			if( (Position.MarketPosition == MarketPosition.Short) && (CurrentBar - 1 > sellTrigBar) && (CurrentBar < sellTrigBar + 3) && ((Close[0] < Open[0])) )
    			{ ExitShort("Scalp");		}
    			
    			//1 bar close in Opposite direction (2 UpBars close after entering trade. 
    			if( (Position.MarketPosition == MarketPosition.Short) && (Close[0] > Open[0]) )
    			{
    				ExitShort();
    			}

    Comment


      #17
      Hello,

      Thank you for the questions.

      For the commissions to work in the backtest there are a couple of steps.

      In the instrument you are testing or in the commissions in the options menu, you will need to enter the commission for the Simulator account as well as your Live connection. If you use market replay you would want to fill in the commission for that as well.

      Next in the strategy properties, select Include Commission.

      This should allow you to see the commission results in the test as well.

      For the question related to the orders, what is your entries per direction set to? If you have it set to 1, it would ignore the second call as you are already entered. if you set this to 2, you should see the second signal as well.

      I look forward to being of further assistance.

      Comment


        #18
        Okay.

        1. Commission Still NOT showing up in Strategy Analyzer: http://screencast.com/t/BU51i3JDCF

        2. On the JPY pairs something is NOT right with the results: they all show profits/Loss in the $1000s http://screencast.com/t/2v1IwB14, the majors show something more accurate such as $30 or $40.

        Reason I say those results impossible for 2 days of data. cause the Quantity on the trade is 1000 contracts or 2000 at most. since this is FOREX.

        Is there a way to get proper results on JPY pairs. I can't actually figure out how to view How much each trade is worth so I can.

        Comment


          #19
          Hello,

          Thank you for the questions.

          The commission you are looking at in the image are the ones for Live trading.

          If you want to use commissions in Simulated or Backtesting you need to add the commission level to the Simulator account and not the Live connection.

          The row would be Currency - Simulator for forex. I see in the image you have selected futures for the Live commissions, if you will be trading forex you would want to add the commission to the currency row for your connection.

          The values you are seeing would be based off of the number of trades you completed. In your image I see that there are a high number of trades for the Net to calculate from. You can view the individual trades in the trades tab for individual results.

          I look forward to being of further assistance.

          Comment


            #20
            Okay I got COmmissions. down. thanks. but this is driving me crazy. please help. I copied the strategy and made it for FOrward testing. but when I do market replay. it's still taking a crazy amount of orders. and NOT exiting in the proper places.

            What AM I DOING wrong. I thought this would've been simplier. I just can't figure this out. The conditions are set to Enter 3000 contracts if True. then if 3 bars close in a row Exit 2000 contracts, and leave the Rest to trail.

            But it's Just NOT working.

            World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.



            Strategy is attached. please help. I don't know what to DO!
            Attached Files

            Comment


              #21
              Hello,

              I will try this on my replay.

              I wanted to ask, I see the two charts in the image, I assume you are comparing the results of these two charts?

              If so they look like they are different types of charts, the one on the left looks like a renko where the one on the right looks like 5 or 15 minutes. Could this be the difference you are seeing?

              I look forward to being of further assistance.

              Comment


                #22
                Oh LOL. no the only chart that matters is the Renko/Price bars. its where the Strategy is on. the other one was for my own viewing purposes.

                Comment


                  #23
                  Another PROBLEM. when Market Replay. check it for today 2/12 at around 0:00 EST.

                  It Fills SELL orders during UP bars. I checked the code, it was too many orders cause I forgot this CalculatesOnBarClose = False so I set
                  Code:
                  		//Setup High VOlume on NEWest Bar, by looking at Previous Bar's High Volume
                  				if(FirstTickOfBar && dgClimax )
                  					{
                  						//SHORT SETUP
                  					
                  						if(Close[1] < Open[1])	
                  						{
                  							dgClimaxDown = true;
                  							dgClimaxUp = false;
                  							selltrigLow = Low[1];
                  							hvDownBar = CurrentBar - 1;
                  						
                  						}
                  						//LONG SETUP
                  						if(Close[1] > Open[1])
                  					
                  						{
                  							dgClimaxUp = true;
                  							dgClimaxDown = false;
                  							buytrigHigh = High[1];
                  							hvUpBar = CurrentBar - 1;
                  						
                  						}
                  						
                  					}
                  On the Indicator script. but I'm still having problems now it fills wrong orders.

                  World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.



                  P.S>> Nevermind it's Still Taking TOO MANY trades no matter what I do. and there all in the Wrong direction. and Wrong Exits. I'm SO LOST

                  Comment


                    #24
                    UPDATED version. Still NO GO

                    Okay this is the absolutely updated Version Just for FORWARD testing only. CalculateonBarClose False. everything is Set to Look after "FirstTickOfBar" and look at Close[1] and Open[1] etc.......

                    I'm Still getting a ton of trades that don't belong.
                    Attached Files

                    Comment


                      #25
                      Hello,

                      Thank you for the reply.

                      The reason there is a difference in what you are seeing in replay is that the volume is reported as 1 for forex replay bars so the volume is much different that it would be live.

                      You would see historical bars having the correct volume from what was recorded but the volume that is played back will be in increments of 1.

                      This will cause partial fills to happen or what you are seeing in the image you sent in.

                      The replay data does not record volume on purpose for forex specifically because this would be broker dependent as there is not a centralized exchange.



                      Please let me know if I may be of additional assistance.

                      Comment


                        #26
                        Okay. so I understand that. but now I LiVe forward tested it using the last Upload.

                        and it's still taking orders it shouldn't http://screencast.com/t/Ch0aJJT4lJEE


                        The Goal is Simple. Up Bar Closes with High Volume = BUY 3000 contracts. 2 bars after this Happens, Close 2000 contracts and leave the rest Open.

                        WHy is this NOT happening. I don't get it. i've done everything I could

                        Comment


                          #27
                          Hello,

                          I looked at the new version.

                          From running it I see historically I am getting the expected outcome of a entry of 3000 followed by a exit of 2000 and another exit of 1000. Running it on live data I have not received enough data to generate the conditions at this point.

                          Have you tried printing the conditions and variables you are using in the condition?

                          The only way it is going to place an order is if your condition is true so that would lead me to believe it may be something in the indicators logic that is providing the signals.

                          In your image you provided, the order in question, this would need to be tested during live data to see if it is the way that the indicator is calculating. You could test this by printing the indicators signal value to see if your condition is becoming true at the wrong time. you can view the output by opening the Tools -> Output Window.

                          Outside of the condition you could add something like the following to determine on each tick if the value is true or not, depending on this you could look for specific down bars as you have pictured to see if the indicator is reporting true at an incorrect time.

                          Code:
                          Print("Buy Signal: " + DG_HighVol_Scalp_FORWARD_Tester(5).BuySignal[0]);
                          Also I had noticed you are using the CurrentBar and adding a value to it to get your amount of bars since the entry. You could simplify this if you wanted by using BarsSinceEntry()


                          Code:
                          if(BarsSinceEntry() >= 1 && BarsSinceEntry() <= 3)
                          this would be the bar after entry or before 3 bars since entry

                          I look forward to being of further assistance.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          661 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          375 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          110 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          574 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          580 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X