Topics

Forum Topics not found

Replies

fundspreader
22 Nov 2018, 12:28

 if (fastMa.Result.HasCrossedAbove(currentSlowMa, 1) && longPosition == null)
            {
                if (shortPosition != null)
                    ClosePosition(shortPosition);
                //ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, label);

                PlaceStopOrder(TradeType.Buy, Symbol, Volume, MarketSeries.High.LastValue, label);

            }
            //&& previousSlowMa < previousFastMa
            else if (fastMa.Result.HasCrossedBelow(currentSlowMa, 1) && shortPosition == null)
            {
                if (longPosition != null)
                    ClosePosition(longPosition);
                //ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, label);

                PlaceStopOrder(TradeType.Sell, Symbol, Volume, MarketSeries.Low.LastValue, label);

            }

 

you can try to use stop order, where it use high or low as the targetprice..

 

hope it helps...

 

Best Regards

 

RKS


@fundspreader