AI Indicator: https://discord.gg/K6VTU6XV

Active positions calculator with net volume size 9 replies
Close all pending orders and open orders once they reach profit target 3 replies
Separating Count of Max Pending Orders and Max Open Trades 2 replies
script to "close open orders" and "open opposite orders" 3 replies
convert indicator that count bars to have it count ticks. is this possible? 0 replies
DislikedHi, how do you get the net pip count from all the open orders currently in the terminal in mql4?Ignored
double sum=0; for(int o=OrdersTotal()-1;o>=0;o—) if(OrderSelect(o,SELECT_BY_POS,MODE_TRADES){ RefreshRates(); if(OrderType()==0)sum+=Bid-OrderOpenPrice(); if(OrderType())sum+=OrderOpenPrice()-Ask;} sum*=0.1; Print(“Order Pip Sum=“+(string)sum);
Disliked{quote} Something like this: double sum=0; for(int o=OrdersTotal()-1;o>=0;o—) if(OrderSelect(o,SELECT_BY_POS,MODE_TRADES){ RefreshRates(); if(OrderType==0)sum+=Bid-OrderOpenPrice(); if(OrderType)sum+=OrderOpenPrice()-Ask;} sum*=0.1; Print(“Order Pip Sum=“+(string)sum);Ignored
double calcNetPips() { double sum=0; for(int i=0; i<OrdersTotal; i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == 1) { RefreshRates(); if(OrderType==0) sum+=Bid-OrderOpenPrice(); else sum+=OrderOpenPrice()-Ask; } } Return sum*=0.1; }
Disliked{quote} why are you multiplying sum by 0.1? and what about your brackets it seems like they're missing for the for loop? Here's my attempt.... double calcNetPips() { double sum=0; for(int i=0; i<OrdersTotal; i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == 1) { RefreshRates(); if(OrderType==0) sum+=Bid-OrderOpenPrice(); else sum+=OrderOpenPrice()-Ask; } } Return sum*=0.1; }Ignored
Disliked{quote} OrderSelect is a bool so “==1” isn’t needed. Multiply by 0.1 to convert from points to pips. And the bracket is not needed if only one thing follows it. Also always count down your orders. But yes I had some typosdoing it on my phone. I edited it just now.
Ignored
Disliked{quote} ok this actually didnt work.. it would always display 35.xx for some reason, even though i know that's not the correct floating pip count.Ignored
if(OrderType()==0)//buy market order else {}//all other orders market+pending
if(OrderType()==0) //buy market order if(OrderType()==1)// sell market order also if(OrderType())//sell market order // may also use the enum terms: //OP_BUY=0,OP_SELL=1 if(OrderType()==OP_BUY) if(OrderType()==OP_SELL)
sum*=0.1; return sum; //or return sum*0.1;