No orders issued part 3 - EasyLanguage Programming | futures io social day trading
futures io futures trading


No orders issued part 3
Updated: Views / Replies:1,610 / 4
Created: by arjfca Attachments:2

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

No orders issued part 3

  #1 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received

No orders issued part 3

To enhance clarity I opted to start a new tread

My probles is to code an entry with a stop order. A new position should be created within each bar following a setup.

A) Look for valid setup after the end of a bar. If BarStatus = 2

B) If valid setup, then issue a stop order for the next bar

c) If price of the following bar (after the setup) cross over my target, a new position as to be created.


See the result on the attached picture


Any help greatly appreciated....
Martin
______________________________________________________________________________
Here is my code for the signal
 
Code
[intrabarOrderGeneration = true]
Variables:
BN (0),       //Bar Number
Q   (50000),     // Quantity to trade 
SL   (0),      // Stop Loss
LE   (0),     // Long Entry target
MTH (False),    //MT_Hammer Flag
NB (False),     // New Bar
Goentry (false),    // All is ok, send order to go long
sp (spaces(1));   // Just a regular space for the printing process
{Look for a valid setup after the completion of a bar ( Barstatus = 2)
MT_Hammer = Setup.  True if found
Q:          Quantity.  Modified after each new setup to show individual transaction only
LE:         Long Entry Target.  Price should go over this target within the next bar
SL:         Stop Loss Target.  If in position, This one will be close if price go below this target
GeEntry:    all is OK, Go Send the order to the market
Print:      Just to make sure that I got visualy the same bar
}
If barstatus = 2 then begin
    If MT_Hammer = True then MTH = True else MTH = False;
 
    if MTH Then begin  
           Q= Q + 10000;   
           LE = H + .0002;   
           SL = L - .0002;    
           Goentry = true;    
           Print (BarNumber + 40:0:0, sp, date:0:0, sp, Time:0:0, sp,H:0:5, sp, low:0:5, sp, Q:0:0);  // To make sure that I got visually the same bar        
           Buy next bars Q contracts  at LE stop;
           setstoploss (q * (Range + .0002) * bigpointvalue); 
  GoEntry = False;
     end; 
end;
My Function MT_Hammer
 
Code
{Hammer Fuction Return Hammer =True if all condition is met
Output:  Tail   
                       Hammer (True or False)                   }
Variables:  Length(0),  Body(0),  Tail(0), Nose(0);
Variables:  LBody(0),   HBody(0);
 
LBody = Minlist(Close, Open);     // Slect the bottom price of the body
HBody =Maxlist(close, open);     // Select the upper price of the body
Body = HBody - LBody;
Tail = LBody - Low;        // Tail = Lower part of the body - low of the bar
Nose = High - HBody;      // Nose = uppr par of the bar
Condition1 = Body < Tail;
Condition2 = Nose < Tail;
//condition3 = close >= high -range/3 ;// close in the top 1/3 od the range
If Barstatus  = 2 then begin
 If condition1 and condition2 then MT_Hammer = true else MT_Hammer = False; // The body has to be smaller than the tail by a determined ratio ( RBT) 
 end;

Attached Thumbnails
No orders issued part 3-eratic_entry.jpg  
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received


Hello,

I took the liberty of modifying your code where I saw fit. Along the way I had to make some assumptions because what you provided was not a complete system. I assumed you wanted to scale in to your position every time there was a hammer formation. This is controlled within your platform and not within the code. Likewise, you do not need to set intrabar order generation (IOG) to On. This can complicate things and does not affect your system. Stop orders to exit and stop entry orders are placed at the close of a bar for the next bar and are executed in realtime without IOG on. I added a trailing stop just to I could test the program.

I also modified the number of contracts to trade one contract per trade. You can easily change this back to what ever you like.

In the example image you can see the system scales into the position with 1 contract after each hammer. It sets a stop order to enter 2 ticks above the high of the hammer to enter. A hard stop is activated for the order bar only. Then a trailing stop is used for all other bars.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Let me know if you have questions. This was built with TradeStation 8.8

 
Code
{
Hammer Fuction Return Hammer =True if all condition is met
Output:  Tail   
Hammer (True or False)
}
Variables:  Length(0),  Body(0),  Tail(0), Nose(0);
Variables:  LBody(0),   HBody(0);
 
LBody = Minlist(Close, Open); // Slect the bottom price of the body
HBody = Maxlist(close, open); // Select the upper price of the body
Body  = HBody - LBody;
Tail  = LBody - Low;          // Tail = Lower part of the body - low of the bar
Nose  = High - HBody;         // Nose = uppr par of the bar

Condition1 = Body < Tail;
Condition2 = Nose < Tail;

If ( condition1 ) And ( condition2 ) Then 
   MT_Hammer = true 
Else 
    MT_Hammer = False; // The body has to be smaller than the tail by a determined ratio ( RBT)
 
Code
//[intrabarOrderGeneration = true]
// IOG does not need to be used to have orders filled intrabar. IOG is used to evaluate your strategy upon every tick.
// It appears to me you are evaluating the close of a 15-minute bar and placing resting orders for next bar, thus
// IOG is not needed.

Variables:
   OneTickValue$(iff(GetExchangeName="FOREX", MinMove/PriceScale*BigPointValue*100000, MinMove/PriceScale*BigPointValue)),
   OneTickValue(iff(GetExchangeName="FOREX", MinMove/PriceScale*100000, MinMove/PriceScale)),
   
   Stop$(0),
 
   BN       (0),           // Bar Number
   Q        (1),           // Quantity to trade 
   SL       (0),           // Stop Loss
   LE       (0),           // Long Entry target
   MTH      (false),       // MT_Hammer Flag
   NB       (false),       // New Bar
   Goentry  (false),       // All is ok, send order to go long
   sp       (spaces(1));   // Just a regular space for the printing process
   
   
{Look for a valid setup after the completion of a bar ( Barstatus = 2)
MT_Hammer = Setup.  True if found
Q:          Quantity.  Modified after each new setup to show individual transaction only
LE:         Long Entry Target.  Price should go over this target within the next bar
SL:         Stop Loss Target.  If in position, This one will be close if price go below this target
GeEntry:    all is OK, Go Send the order to the market
Print:      Just to make sure that I got visualy the same bar
}

Once SetStopPosition; 

If ( MT_Hammer ) Then
Begin

   //MTH = true;
   //Goentry = true;
   
   //Q  = Q + 1;
   LE = H + 2*OneTickValue;   
   SL = L - 2*OneTickValue;    
   
   // To make sure that I got visually the same bar        
   Print (BarNumber + 40:0:0, sp, date:0:0, sp, Time:0:0, sp,H:0:5, sp, L:0:5, sp, Q:0:0);  

   // We do not want to place a buy order when range=0
   // Check for OnTickValue > 0 to ensure we do not get a division-by-zero error.
   
   If ( Range > 0 ) And ( OneTickValue > 0 ) Then 
   Begin
      Buy("LE") Q contracts next bar at LE stop; 
      Stop$ = ( (range)/OneTickValue*OneTickValue$ );
      setstoploss ( Stop$ );
   End;
   
   //GoEntry = false;
   
End;

// Trailing Exit for Longs
// Trailing stop handles trade after inital purchase.

If ( MarketPosition = 1 ) Then
   Sell("TSL") next bar at Lowest(Low,3) stop;

Reply With Quote
The following user says Thank You to Jeff65 for this post:
 
  #4 (permalink)
Elite Member
Montreal, Canada
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: Interactive Broker
Favorite Futures: Forex
 
Posts: 262 since Sep 2010
Thanks: 436 given, 86 received

Resolve

Hello Jeff

Many thanks again for your input. I always learn and progress with your inputs.

You where right , this exercise was not at all a trading concept, Only to described my problems to put entry on the system. I was focussing only on the technicality of orders process, nothing from the stop loss. (insane, i know, but that was the my goal. )

For about 1 hour, I chat with Dave M. from Multicharts. Using the remote toll he found that I had

IntraBarOrderGeneration = True with Bar Magnifier = 1 tick enabled at the same time. Together they mess-up the calculation and orders wheres not put or put later. That was the main problem.

Now, I could go on with my real sytem. and yes, the main part is the stop management.

Best wish of success and happiness for 2011 to you and Big Mike forum members.


Martin

Reply With Quote
 
  #5 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received

You're welcome. Glad to hear things are progressing.



arjfca View Post
Hello Jeff

Many thanks again for your input. I always learn and progress with your inputs.

You where right , this exercise was not at all a trading concept, Only to described my problems to put entry on the system. I was focussing only on the technicality of orders process, nothing from the stop loss. (insane, i know, but that was the my goal. )

For about 1 hour, I chat with Dave M. from Multicharts. Using the remote toll he found that I had

IntraBarOrderGeneration = True with Bar Magnifier = 1 tick enabled at the same time. Together they mess-up the calculation and orders wheres not put or put later. That was the main problem.

Now, I could go on with my real sytem. and yes, the main part is the stop management.

Best wish of success and happiness for 2011 to you and Big Mike forum members.


Martin


Reply With Quote

Reply



futures io > > > > > No orders issued part 3

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webinar: Fibonacci Trading Part I Fat Tails The Elite Circle 94 June 17th, 2012 03:15 PM
White House Insider: Obama Hesitated – Panetta Issued Order to Kill Osama Bin Laden MetalTrade News and Current Events 0 May 5th, 2011 10:29 AM
No orders issued using Buy Stop (Part 2) arjfca EasyLanguage Programming 5 December 17th, 2010 08:32 AM
No orders issued using Buy Stop arjfca EasyLanguage Programming 3 December 14th, 2010 06:33 AM
AHR Campaign (part -I-) ahrinc Traders Hideout 1 June 6th, 2010 05:02 PM


All times are GMT -4. The time now is 06:56 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-16 in 0.10 seconds with 20 queries on phoenix via your IP 54.145.16.43