Rooky questionning, Coding a conditionnal entry + a stop loss if done - EasyLanguage Programming | futures io social day trading
futures io futures trading


Rooky questionning, Coding a conditionnal entry + a stop loss if done
Updated: Views / Replies:1,931 / 7
Created: by arjfca Attachments:1

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
 

Rooky questionning, Coding a conditionnal entry + a stop loss if done

  #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

Rooky questionning, Coding a conditionnal entry + a stop loss if done

Hello

I'm trying to code my first signal using Multicharts and their is some concept that I dont understand very well.

My broker is IB and orders should reside on their servers

Interogation 1:
Let say I want to send an order like

1- Conditionnal entry: Buy next bar 100 000 @ 1.3978 stop
2- If #1 is done Conditionnal stop loss sell 100 000 @ 1.3968 stop

How will I code it? I would like both orders to be put on IB server at the same time. The 2' orders is conditionnal to the #1 order be executed.

Interogation2:
If the order # 1 is not executed by the end of the bar, do I need to cancel it? or, Cancel both?

Interogation3:
Entry as been done and stop loss as not been reached. In profit and i would like to protect some profit. How do I modify the stop loss price value?, meaning modifying the #2 order

Interogation4:
How do I select the synchronisation mode. I read that this mode will validate each entry to insure a synchronisation between calculated positions and positions on broker server.

Any help greatly appreciated.

Martin

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



arjfca View Post
Interogation 1:
Let say I want to send an order like

1- Conditionnal entry: Buy next bar 100 000 @ 1.3978 stop
2- If #1 is done Conditionnal stop loss sell 100 000 @ 1.3968 stop

How will I code it? I would like both orders to be put on IB server at the same time. The 2' orders is conditionnal to the #1 order be executed.

Both orders are on the sever during the trigger bar. Both are conditional to your "conditional" entry. The code example below might help. I'll try to get to your other questions later today.

 
Code
//1- Conditionnal entry: Buy next bar 100 000 @ 1.3978 stop
//2- If #1 is done Conditionnal stop loss sell 100 000 @ 1.3968 stop
input:
iContracts( 10 ),
iEntryPrice( 1.3978),
iStopInTicks( 10 );

Variables:
MP(0),
Condition(true);

MP = MarketPosition;

If ( Condition = True ) Then
Begin
   If ( MP = 0 ) Then buy iContracts contracts next bar at iEntryPrice stop;
   SetStopLoss( iStopInTicks * iContracts * BigPointValue );
End

Reply With Quote
The following user says Thank You to Jeff65 for this post:
 
  #4 (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


arjfca View Post


Interogation2:
If the order # 1 is not executed by the end of the bar, do I need to cancel it? or, Cancel both?



No need to cancel either order.

Reply With Quote
The following user says Thank You to Jeff65 for this post:
 
  #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


arjfca View Post
Interogation3:
Entry as been done and stop loss as not been reached. In profit and i would like to protect some profit. How do I modify the stop loss price value?, meaning modifying the #2 order

You don't need to modify the original stop lost created by SetStopLoss. You can simply create a new stop loss that trails your profitable trade. Here are two ways.

 
Code
input:
iContracts( 10 ),
iEntryPrice( 1.3978),
iStopInTicks( 10 );

Variables:
NewStopPrice(0),
Stop$(0),
MP(0),
Condition(true);

MP = MarketPosition;
Stop$ =  iStopInTicks * iContracts * BigPointValue;

If ( Condition = True ) Then
Begin

   If ( MP = 0 ) Then buy iContracts contracts next bar at iEntryPrice stop;
   
   // This sets a hard stop that is active on the very bar you enter.
   SetStopLoss( Stop$ );
   
End;

// Create dollar trailing stop that follows trade as you make profit. 
SetDollarTrailing( Stop$ );

// ...OR Simply place a stop order at a specific price as profit climbs

If ( OpenPositionProfit > 100 ) Then
Begin
   NewStopPrice = 1.3985; // set your new stop price after profit
   Sell next bar at NewStopPrice stop;
End;

Reply With Quote
The following 2 users say Thank You to Jeff65 for this post:
 
  #6 (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


arjfca View Post
Interogation4:
How do I select the synchronisation mode. I read that this mode will validate each entry to insure a synchronisation between calculated positions and positions on broker server.

Sorry, not familiar with this one.

Reply With Quote
 
  #7 (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

Thanks many time Jeff. I did have a much better undertanding of the subject


HTML Code:
You don't need to modify the original stop lost created by SetStopLoss.
You can simply create a new stop loss that trails your profitable trade. Here are two ways.
My understanding. All stop is control via your PC. All you need is install new value and software will take care of it.


Have a great day and Happy trading time for the new year to come.

Martin

Reply With Quote
 
  #8 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,354 given, 83,235 received


arjfca View Post
Interogation4:
How do I select the synchronisation mode. I read that this mode will validate each entry to insure a synchronisation between calculated positions and positions on broker server.

When adding the signal to your chart, go to Format Signals, then Properties, then Auto Trading tab.

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


Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:

Reply



futures io > > > > > Rooky questionning, Coding a conditionnal entry + a stop loss if done

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
Coding a simple entry and exit johni EasyLanguage Programming 10 July 1st, 2011 07:44 AM
Dynamic Stop Loss wallsteetking NinjaTrader Programming 2 March 7th, 2011 09:59 AM
"Stop If Bid" command for entry's and stop loss arjfca EasyLanguage Programming 4 October 7th, 2010 06:05 PM
Trailing stop loss kavin729 NinjaTrader Programming 1 August 20th, 2010 02:17 PM
Stop Loss Order Big Mike Terms (Glossary) 0 June 28th, 2010 01:29 AM


All times are GMT -4. The time now is 09:11 AM.

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.15 seconds with 20 queries on phoenix via your IP 54.83.122.227