NexusFi: Find Your Edge


Home Menu

 





No orders issued using Buy Stop


Discussion in EasyLanguage Programming

Updated
    1. trending_up 4,338 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 arjfca 
Montreal, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
Posts: 263 since Sep 2010
Thanks Given: 440
Thanks Received: 91

Hello

I'm writing my first signal in Multicharts Easylanguage. All parameters to enter in the loop are ok and are reflected in the print command
I'm suspecting the stop command.

I trully accept the fact that it is difficult to debug only a portion of the code, but who knows if I make a big apparent mistake.

Any help appreciated

Martin

Here is a portion of my code.

IntraBarGeneration = True
 
Code
                            
 
If MyPosition = 0 then begin // No position in the market
    
If Havelong = true then begin
        
Print( "Long ", QTY, spaces(1), PricetargetL:0:5);
        
Buy ("Long 1") next bar QTY contracts at PriceTargetL stop;
        
Setstoploss (Par * Qty* BigPointValue);
     
end;
 
 
   If 
HaveShort = true then begin
      Sell 
("Short 1") next bar QTY contracts at PriceTargetS Stop;
      
SetStopLoss (Par * QTY* BigPointValue);
   
end;
end; //MyPosition = 0 then begin 
 
Some value from the print command.  I would had no value if   HaveLong = False 
MyPosition = 0
Print("Long ",QTY,spaces(1),PricetargetL:0:5);

 
Code
Long 125000.00 1.34520
Long 100000.00 1.34510
Long 95000.00 1.34540
Long 90000.00 1.34510
Long 86000.00 1.34560


Started this thread Reply With Quote

 
  #3 (permalink)
Jeff65
Gurnee, IL
 
Posts: 46 since Apr 2010
Thanks Given: 17
Thanks Received: 97


Just looking at the code it seems yor stop order are not being placed on each bar. You have your stop order within the block defined by a flat position: market position = 0

When you enter a trade, market position is not zero, thus yor stop is not placed except for the bar when your order is entered.


Reply With Quote
Thanked by:
  #4 (permalink)
 arjfca 
Montreal, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
Posts: 263 since Sep 2010
Thanks Given: 440
Thanks Received: 91

Hello Jeff

Yes, that could be a real problem. I will work arround and post result later.

Martin


Started this thread Reply With Quote




Last Updated on December 14, 2010


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts