Thread: How to code?
View Single Post
  #1877 (permalink)  
Old 07-02-2009, 07:40 PM
rortiz77 rortiz77 is offline
Junior Member
 
Join Date: Jun 2009
Posts: 3
rortiz77 is on a distinguished road
Thanks for the info...

Quote:
Originally Posted by SPACECHIMP View Post
int start()
{
int total,ord,i;

string symbol;

total = OrdersTotal();

for(i=0;i<total;i++)

{

OrderSelect(i,SELECT_BY_POS);

if(OrderSymbol() = Symbol())ord++;

}

if(ord>0) return (0); //Abort! A Position For This Pair is Already Open

//the rest of my program code

}

I've found in reality, I've had to use pauses for a couple seconds in the code due to brokers not instantly opening positions.
Thank you for taking your time to show me this code! I don't think my screen shots were sufficient to explain the logic of what I'm trying to achieve. Here's the explanation in witting...and just as an example I am using a "Buy" scenario. Eventually I would like it to do both "Buy" and "Sell"

Scenario 1: If your buy trade goes with you...
--Trade 1, T/P at 70 pips
--Trade 2, 30 pips appart from trade 1, T/P at 70 pips
--Trade 3, 30 pips away from trade 2, T/P at 70 pips
** 210 pips total

Scenario 2: If your buy trade goes against you...put in a trade every 60 pips for three trades and wait for the market to pull back in your direction
--trade 1 bad...enter new contingency buy trade at -60 pips from the price of trade 1.
--trade 2 bad...enter new contingency buy trade at -60 pips from the price of trade 2.
--trade 3 bad...enter no more trades
--wait for reversal signs...parabolic dot = bottom...if looks like its moving in our direction then enter a 4th buy
--wait 30 more positive pips then enter 5th buy trade...continue to enter buy trades (6, 7, 8 trade) until it reaches the level that the 3rd contingency trade was at....then wait for the original first 1, and follow the steps of scenario 1.

Is it possible to get the code for this logic? I would be greatly appreciative!!!
Reply With Quote