Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple strategy doesnt open trades

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

    Simple strategy doesnt open trades

    I have a simmple strategy that doesnt open trades.
    If i remove
    ExitLongStopMarket(0, true, 1, fvgIndicator.LowerPriceL[0], "SLL", "Long");
    ExitLongLimit(0, true, 1, Position.AveragePrice + (TickSize * 35), "PTL", "Long");
    and just use set methods strategy opens fine
    SetProfitTarget(CalculationMode.Ticks, 25);
    SetStopLoss(CalculationMode.Ticks, 25);
    I dont want to use set methods... No errors
    ​​

    Code:
        protected override void OnBarUpdate()
            {
                if(CurrentBar < 10)
                    return;
    //            if    (CurrentBars[0] < 10 || CurrentBars[1] < 10 )
    //                return;
    
                if(Low[0] < fvgIndicator.UpperPriceL[0]  && fvgIndicator.IsLongFVG[0] == -1 )                    
    
                {
    
                    EnterLong(1, "Long");
                    Print("Entering Long" + Time[0]);
    
                    if (Position.MarketPosition == MarketPosition.Long ) {
                        if(Position.AveragePrice - (fvgIndicator.LowerPriceL[0]) <= GetCurrentBid()){
                         ExitLongStopMarket(0, true, 1, fvgIndicator.LowerPriceL[0], "SLL", "Long");
                        ExitLongLimit(0, true, 1, Position.AveragePrice + (TickSize * 35), "PTL", "Long");
                        }
                    }
    
                }
    
                if(High[0] > fvgIndicator.LowerPriceS[0]  && fvgIndicator.IsShortFVG[0] == 1 )    
                {
    
                    EnterShort(1, "Short");
                    Print("Entering Short" + Time[0]);
    
                }
    
    
    
    
            }​

    #2
    Hello tkaboris,

    The given code should not work because you used the wrong signal name for those orders.

    Comment


      #3
      When I enter long i enter with "Long" and longstopmarket also uses "Long". why is it wrong signal name?

      Comment


        #4
        Hello tkaboris,

        The code you provided is a short order with the name "Short". The exit orders are looking for an entry named "Long". Make sure you are using the right signal names or provide an accurate sample of the code.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X