FX取引ルール確立のために

取引方針が定まらぬ臆病者の外国為替証拠金取引の行方。 取引ルールの柱にテクニカルな売買サインを導入中。システム開発状況を全て公開。

スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

トラップリピートイフダン売りのソースコード

トラップリピートイフダンの売りバージョンのソースコードです

かなり長いので「続きを読む」を参照してください


[当サイトで使っている自動売買システム]

FXCMはMT4よりも優れていると言っています

中身の分からないストラテジーがいやで
自分でストラテジーを作って運営しています

初めての方はこちらから
ストラテジートレーダー超入門 自動売買プログラミング編

Strategy Trader 紹介ビデオ 取扱説明 関連サイト

ストラテジートレーダー概要

ストラテジートレーダーβ版利用ガイド

[他の自動売買サイトを探す]

人気blogランキング






[相場の流れは]
FX ポータル
吉田さん ドルは売られ過ぎ
陳さん  有事のドル
西原さん オージーは注意、逃避通貨はスイス
松田さん ユーロはチキン
今井さん 中東情勢で円安が反転 欧州通貨は乱高下?
using System;
using System.Drawing;
using Broker.StrategyLanguage.Function.BuiltIn;
using Fx2GoCommon;

namespace Broker.StrategyLanguage.Strategy {
public class TrapRepeatSell : BaseStrategyAdvisor {

private double m_orderprice1 = 84.00 ;

private double m_orderwidth = 0.5 ;

private double m_orderprice2 ;

private double m_orderprice3 ;

private double m_orderprice4 ;

private double m_orderprice5 ;

private double m_orderprice6 ;

private double m_orderprice7 ;

private double m_orderprice8 ;

private double m_orderprice9 ;

private double m_orderprice10 ;

private IPriceOrder m_order1;

private IPriceOrder m_order2;

private IPriceOrder m_order3;

private IPriceOrder m_order4;

private IPriceOrder m_order5;

private IPriceOrder m_order6;

private IPriceOrder m_order7;

private IPriceOrder m_order8;

private IPriceOrder m_order9;

private IPriceOrder m_order10;

private double m_Profit_Target_Amount = 600;

private double m_Stop_Amount = 3000;

private double m_shareorposition = 1;

private int m_OpenLots ;

private int m_maxposition = 10;

public TrapRepeatSell(object _ctx):base(_ctx){}


[Input]
public double orderprice1{
get { return m_orderprice1; }
set { m_orderprice1 = value; }
}

[Input]
public double orderwidth{
get { return m_orderwidth; }
set { m_orderwidth = value; }
}

[Input]
public int maxposition{
get { return m_maxposition; }
set { m_maxposition = value; }
}

[Input]
public double shareorposition{
get { return m_shareorposition; }
set { m_shareorposition = value; }
}

[Input]
public double Profit_Target_Amount{
get { return m_Profit_Target_Amount; }
set { m_Profit_Target_Amount = value; }
}
[Input]
public double Stop_Amount{
get { return m_Stop_Amount; }
set { m_Stop_Amount = value; }
}



protected override void Construct() {

m_order1 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order1", OrderAction.SellShort));

m_order2 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order2", OrderAction.SellShort));

m_order3 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order3", OrderAction.SellShort));

m_order4 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order4", OrderAction.SellShort));

m_order5 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order5", OrderAction.SellShort));

m_order6 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order6", OrderAction.SellShort));

m_order7 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order7", OrderAction.SellShort));

m_order8 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order8", OrderAction.SellShort));

m_order9 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order9", OrderAction.SellShort));

m_order10 = OrdersFactory.CreateLimit
(new OrdersCreateParams(Lots.Default, "order10", OrderAction.SellShort));
}




protected override void Initialize() {

}

protected override void Execute(){

if (maxposition > 10)return;

m_orderprice2 = orderprice1 + m_orderwidth;

m_orderprice3 = orderprice1 + m_orderwidth*2;

m_orderprice4 = orderprice1 + m_orderwidth*3;

m_orderprice5 = orderprice1 + m_orderwidth*4;

m_orderprice6 = orderprice1 + m_orderwidth*5;

m_orderprice7 = orderprice1 + m_orderwidth*6;

m_orderprice8 = orderprice1 + m_orderwidth*7;

m_orderprice9 = orderprice1 + m_orderwidth*8;

m_orderprice10 = orderprice1 + m_orderwidth*9;


m_OpenLots = StrategyInfo.MarketPosition ;


if (maxposition ==1){


if ((m_OpenLots == 0) & (Bars.Low[0] < m_orderprice1)) {
m_order1.Generate(orderprice1);
}
}

if (maxposition ==2){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
}

if (maxposition ==3){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}


if (maxposition ==4){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}
if (maxposition ==5){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -4) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}

if (maxposition ==6){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -4) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -5) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}


if (maxposition ==7){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -4) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -5) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -6) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}

if (maxposition ==8){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -4) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -5) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -6) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -7) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}

if (maxposition ==9){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -4) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -5) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -6) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -7) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -8){

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
}

if (maxposition ==10){

if (m_OpenLots == 0){

if (Bars.Low[0]<=m_orderprice1){
m_order1.Generate(orderprice1);
}
if (Bars.Low[0]<=m_orderprice2) {
m_order2.Generate(m_orderprice2);
}
if (Bars.Low[0]<=m_orderprice3){
m_order3.Generate(m_orderprice3);
}
if (Bars.Low[0]<=m_orderprice4){
m_order4.Generate(m_orderprice4);
}
if (Bars.Low[0]<=m_orderprice5){
m_order5.Generate(m_orderprice5);
}
if (Bars.Low[0]<=m_orderprice6){
m_order6.Generate(m_orderprice6);
}
if (Bars.Low[0]<=m_orderprice7){
m_order7.Generate(m_orderprice7);
}
if (Bars.Low[0]<=m_orderprice8){
m_order8.Generate(m_orderprice8);
}
if (Bars.Low[0]<=m_orderprice9){
m_order9.Generate(m_orderprice9);
}
if (Bars.Low[0]<=m_orderprice10){
m_order10.Generate(m_orderprice10);
}
}

if (m_OpenLots == -1){

if ((Bars.Low[0]<=m_orderprice1)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order1") ){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order2") ){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order3") ){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order4") ){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order5") ){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order6") ){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order7") ){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice7)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order8") ){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice8)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order9") ){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice9)&
(CurrentPosition.OpenTrades[0].Entry.Name != "order10") ){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -2) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -3) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -4) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -5) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -6) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -7) {

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -8){

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}
if (m_OpenLots == -9){

if ((Bars.Low[0]<=m_orderprice1)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order1")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order1"))){
m_order1.Generate(orderprice1);
}
if ((Bars.Low[0]<=m_orderprice2)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order2")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order2"))){
m_order2.Generate(m_orderprice2);
}
if ((Bars.Low[0]<=m_orderprice3)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order3")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order3"))){
m_order3.Generate(m_orderprice3);
}
if ((Bars.Low[0]<=m_orderprice4)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order4")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order4"))){
m_order4.Generate(m_orderprice4);
}
if ((Bars.Low[0]<=m_orderprice5)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order5")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order5"))){
m_order5.Generate(m_orderprice5);
}
if ((Bars.Low[0]<=m_orderprice6)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order6")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order6"))){
m_order6.Generate(m_orderprice6);
}
if ((Bars.Low[0]<=m_orderprice7)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order7")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order7"))){
m_order7.Generate(m_orderprice7);
}
if ((Bars.Low[0]<=m_orderprice8)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order8")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order8"))){
m_order8.Generate(m_orderprice8);
}
if ((Bars.Low[0]<=m_orderprice9)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order9")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order9"))){
m_order9.Generate(m_orderprice9);
}
if ((Bars.Low[0]<=m_orderprice10)&
((CurrentPosition.OpenTrades[0].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[1].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[2].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[3].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[4].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[5].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[6].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[7].Entry.Name != "order10")&
(CurrentPosition.OpenTrades[8].Entry.Name != "order10"))){
m_order10.Generate(m_orderprice10);
}
}

}

if ((shareorposition == 1)){
CurSpecOrdersMode = SpecOrdersMode.perLot;
}
else{
CurSpecOrdersMode = SpecOrdersMode.perPosition;
}
if (Functions.DoubleGreater(Profit_Target_Amount, 0)){
GenerateProfitTarget(Profit_Target_Amount);
}
if (Functions.DoubleGreater(Stop_Amount, 0)){
GenerateStopLoss(Stop_Amount);
}
}
}
}
スポンサーサイト

コメント

コメントの投稿


管理者にだけ表示を許可する

トラックバック

トラックバックURLはこちら
http://fxrun.blog55.fc2.com/tb.php/1775-6b541aad
この記事にトラックバックする(FC2ブログユーザー)

FC2Ad

上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。